/**
 * 服务端响应数据模型
 * 
 * 用途：封装服务端返回的批量脑波数据，包含时间戳信息用于数据覆盖
 * 方法：使用数据类封装服务端响应的数据结构，支持JSON反序列化
 * 原理：根据时间戳判断数据的新旧程度，实现新数据覆盖旧数据的机制
 */
package com.example.brain_wave.bluetooth.model

/**
 * 服务端返回的单个数据点
 */
data class ServerDataPoint(
    val timestamp: Long,
    val rawValue: Int?,
    val delta: Int,
    val theta: Int,
    val lowAlpha: Int,
    val highAlpha: Int,
    val lowBeta: Int,
    val highBeta: Int,
    val lowGamma: Int,
    val midGamma: Int,
    val attention: Int,
    val meditation: Int,
    val poorSignal: Int,
    val blinkStrength: Int,
    // 服务端可能返回的额外处理结果
    val processedResult: String? = null,
    val qualityScore: Double? = null
)

/**
 * 服务端响应数据
 */
data class ServerResponseData(
    val success: Boolean,
    val message: String? = null,
    val sessionId: String,
    val roomId: String,
    val responseTimestamp: Long,
    // 批量数据点，按时间戳排序
    val dataPoints: List<ServerDataPoint>,
    // 服务端处理状态
    val processingStatus: String? = null,
    val totalProcessed: Int = 0
)